package generic_test;

public class MyPoint<T> {

    private T x;
    private T Y;
    public T getX() {
        return x;
    }

    public void setX(T x) {
        this.x = x;
    }

    public T getY() {
        return Y;
    }

    public void setY(T y) {
        Y = y;
    }


    public static void main(String[] args) {
        MyPoint<String>point = new MyPoint<>();
        point.setX("东经20度");
        point.setY("北纬20度");
        String x = point.getX();
        String y = point.getY();
        System.out.println("x = "+x+", y = "+y);
    }
}
